/**
 * <p>
 * 表格配置
 *
 * @Author：Roy
 * @Description：项目
 * @Date：Create by 2023-11-23 09:55:22
 */
const headerConfig = {
  'optimizationSuggestion': [
    {
      prop: 'id',
      name: '编号',
      minWidth: 110
    },
    {
      prop: 'name',
      name: '名称',
      minWidth: 110
    },
    {
      prop: 'key',
      name: 'key',
      minWidth: 110
    },
    {
      name: '数值',
      minWidth: 130,
      formatter: (row) => {
        const minValue = row.minValue
        const maxValue = row.maxValue
        return minValue != null || maxValue != null ? '有' : '无'
      }
    }, {
      name: '范围',
      minWidth: 130,
      formatter: (row) => {
        const minValue = row.minValue
        const maxValue = row.maxValue
        let result = ''
        if (minValue != null) {
          result += minValue + '%'
        }
        if (maxValue != null) {
          result += ' - ' + maxValue + '%'
        }
        return result
      }
    },
    {
      name: '操作',
      width: 200,
      fixed: 'right',
      thStyle: { 'text-align': 'left' },
      operateList: [
        {
          type: 'btnText',
          label: '编辑',
          id: 'optimizationSuggestion-edit',
          authId: 'ecp-admin:optimizationSuggestion:update',
          config: { type: 'text' },
          // style: { color: 'rgb(66, 185, 131)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        }
      ]
    }
  ]
}

export default {}
export { headerConfig }
